package cm.project;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class Test4 {
    public static void main(String[] args) throws IOException {
        List<String>list=new ArrayList<>();
        list.add("迪丽热巴");
        list.add("古力娜扎");
        list.add("周杰伦");
        list.add("蔡徐坤");
        for (String s : list) {
            BufferedWriter bw=new BufferedWriter(new FileWriter("Task1.txt",true));
            bw.write(s);
            bw.write("\r\n");
            bw.close();
        }

    }
}
